import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const Login = () => import(/* webpackChunkName:"login_Index" */ '../views/Login.vue')
const Index = () => import(/* webpackChunkName:"login_Index" */ '../views/Index.vue')
const Users = () => import(/* webpackChunkName:"user" */ '../components/users/Users.vue')
const Rights = () => import(/* webpackChunkName:"roles" */ '../components/roles/Rights.vue')
const Roles = () => import(/* webpackChunkName:"roles" */ '../components/roles/Roles.vue')
const Categories = () => import(/* webpackChunkName:"cate" */ '../components/cate/Categories.vue')
const Params = () => import(/* webpackChunkName:"cate" */ '../components/cate/Params.vue')
const Goods = () => import(/* webpackChunkName:"cate" */ '../components/cate/Goods.vue')
const Add = () => import(/* webpackChunkName:"cate" */ '../components/cate/Add.vue')
const Orders = () => import(/* webpackChunkName:"orders" */ '../components/orders/Orders.vue')
const Reports = () => import(/* webpackChunkName:"reports" */ '../components/reports/Reports.vue')
const Cates = () => import(/* webpackChunkName:"catest" */ '../components/catest/Cates.vue')
const routes = [
  {
    path: '/',
    redirect: "login"
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/index',
    component: Index,
    children: [
      {
        path: '/users',
        component:Users,
        meta: {
          bread: ['用户管理', '用户列表']
        }
      },
      {
        path: '/roles',
        component:Roles,
        meta: {
          bread: ['权限管理', '角色列表']
        }
      },
      {
        path: '/rights',
        component: Rights,
        meta: {
          bread: ['权限管理', '权限列表']
        }
      },
      {
        path: '/categories',
        component: Categories,
        meta: {
          bread: ['商品管理', '商品列表']
        }
      },
      {
        path: '/goods',
        component: Goods,
        meta: {
          bread: ['商品管理', '分类参数']
        },
      },
      {
        path: '/params',
        component: Params,
        meta: {
          bread: ['商品管理', '商品分类']
        }
      },
      {
        path: '/goods/add',
        component: Add,
        meta: {
          bread: ['商品管理', '商品分类',"商品添加"]
        }
      },
      {
        path: '/orders',
        component: Orders,
        meta: {
          bread: ['订单管理', '订单列表']
        }
      },
      {
        path: '/reports',
        component: Reports,
        meta: {
          bread: ['数据统计', '数据列表']
        }
      },
    ]
  },
  {
    path: '/catest',
    component: Cates,
  },
]

const router = new VueRouter({
  routes
})

export default router
